package com.bbtShop.api;

import com.bbtShop.core.model.*;
import com.bbtShop.service.SysMenuService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : manke
 * @Description
 * @Date: 2020/10/31 19:36
 */
@Api(value = "SysMenu", description = "系统权限菜单")
@RestController
@RequestMapping("/sysMenu")
public class SysMenuController {
    @Autowired
    private SysMenuService sysMenuService;

    @ApiOperation(value = "addUpdate", notes = "添加修改")
    @PostMapping("/addUpdate")
    public ApiResponse<Object> addUpdateProduct(@RequestBody SysMenu sysMenu) {
        sysMenuService.addUpdate(sysMenu);
        return ApiResponse.success();
    }
    @ApiOperation(value = "roleBindMenu", notes = "角色菜单绑定")
    @PostMapping("/roleBindMenu")
    public ApiResponse<Object> roleBindMenu(@RequestBody SysRoleMenuVo sysRoleMenuVo) {
        sysMenuService.roleBindMenu(sysRoleMenuVo);
        return ApiResponse.success();
    }

}
